package com.qingding.activity;

import android.content.ClipboardManager;
import android.content.Context;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.Toast;

import com.qingding.R;

public class FeedBackActivity extends AppCompatActivity {

    private Button button;
    private EditText editText;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_feed_back);

        button = (Button)findViewById(R.id.copy);
        editText =(EditText)findViewById(R.id.ways);

        button.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                String copy = editText.getText().toString();
                ClipboardManager cm = (ClipboardManager) getSystemService(Context.CLIPBOARD_SERVICE);
                cm.setText(copy);
                Toast.makeText(FeedBackActivity.this,"已复制到剪切板", Toast.LENGTH_SHORT).show();
            }
        });



    }
}
